#ifndef QQ_CLIENT_VIEW
#define QQ_CLIENT_VIEW

#include <qapplication.h>
#include <qdockwidget.h>
#include <qlayout.h>
#include <qmainwindow.h>
#include <qpropertyanimation.h>
#include <qscreen.h>
#include <qstackedwidget.h>
#include <qstyleoption.h>
#include <qtimer.h>
#include <qtoolbar.h>
#include <qmath.h>

#include <Def.h>
#include <stdafx.h>
#include <ElaAppBar.h>
#include <ElaApplication.h>
#include <ElaEventBus.h>
#include <ElaMenu.h>
#include <ElaTheme.h>

#include "widget/QQNavigationBar.h"
#include "widget/QQCentralStackedWidget.h"

class QQClientView : public QMainWindow
{
	Q_OBJECT
public:
	explicit QQClientView(QWidget* parent = nullptr);
	~QQClientView();
	void moveToCenter();
	void setBaseImage(const QImage& image);
	QImage getBaseImage() const;

	void setIsStayTop(bool isStayTop);
	bool getIsStayTop() const;
	void setIsFixedSize(bool isFixedSize);
	bool getIsFixedSize() const;
	void setIsDefaultClosed(bool isDefaultClosed);
	bool getIsDefaultClosed() const;
	void setAppBarHeight(int appBarHeight);
	int getAppBarHeight() const;
	void setWindowButtonFlag(ElaAppBarType::ButtonType buttonFlag, bool isEnable = true);
	void setWindowButtonFlags(ElaAppBarType::ButtonFlags buttonFlags);
	ElaAppBarType::ButtonFlags getWindowButtonFlags() const;

	void setUserInfoCardVisible(bool isVisible);
	void setUserInfoCardPixmap(QPixmap pixmap);
	void setUserInfoCardSize(QSize size);

	void setNavigationIconSize(QSize size);

	void setFooterIconSize(QSize size);

	QString addPageNode(QWidget* page, QIcon icon = QIcon());
	QString addPageNode(QWidget* page, int keyPoints = 0, QIcon icon = QIcon());
	QString addFooterNode(int keyPoints = 0, QIcon icon = QIcon());
	QString addFooterNode(QWidget* page, int keyPoints = 0, QIcon icon = QIcon());

	void setNodeKeyPoints(QString nodeKey, int keyPoints);
	int getNodeKeyPoints(QString nodeKey) const;

	void setIsCentralStackedWidgetTransparent(bool isTransparent);
	bool getIsCentralStackedWidgetTransparent() const;

	void showForceOutLineWindow();
	void closeWindow();

signals:
	void userInfoCardClicked();
	void closeButtonClicked();
	void navigationNodeClicked(QString nodeKey);
protected:
	Q_TAKEOVER_NATIVEEVENT_H
private slots:
	void onNavigationNodeClicked(QString nodeKey);
private:
	QImage mBaseImage;
	QMap<QString, int> mRouteMap;
	ElaAppBar* mAppBar;
	QQNavigationBar* mNavigationBar;
	QQCentralStackedWidget* mCenterStackedWidget;
};

#endif // !QQ_CLIENT_VIEW